package com.bw.module_inspection.adapter

import com.bw.module_inspection.R
import com.bw.module_inspection.model.InspectionEntity
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
/**
 * 智慧园区-07-巡检管理V1.1 史建军20250512
 */
class InspectionAdapter:BaseQuickAdapter<InspectionEntity,BaseViewHolder>(R.layout.item_inspection_layout) {
    override fun convert(holder: BaseViewHolder, item: InspectionEntity) {
        holder.setText(R.id.tv_Project_Name,item.projectId)
        holder.setText(R.id.tv_name,item.pointName)
        holder.setText(R.id.tv_type,item.patrolType)
        holder.setText(R.id.tv_position,item.pointLocation)
        holder.setText(R.id.tv_state,item.patrolStandard)

        if (item.patrolType.equals("安防巡检")){
            holder.setBackgroundResource(R.id.tv_type,R.drawable.shape_orange)
        }else if (item.patrolType.equals("家居巡检")){
            holder.setBackgroundResource(R.id.tv_type,R.drawable.shape_blue)
        }else{
            holder.setBackgroundResource(R.id.tv_type,R.drawable.shape_green)
        }
    }


}